// 暂时未用
import axios from "axios";

interface BookList{
    author: string,
    bookId: number,
    categoryName: string,
    chapterStatus: string,
    coverImg: string,
    desc: string,
    title:string,
    word: string,
  }

export default function GetBooksUseNameAndPage(SearchValue:string,page:number,pageSize:number){
    let bookList:BookList[] = [];
    axios.get('http://yuenov.com:15555/app/open/api/book/search', {
          params: {
            keyWord: SearchValue,
            pageNum: page,
            pageSize: pageSize
          }
        }).then((response)=>{
          // console.log("查询结果:", response.data);
        //   let NewItems: BookList[] =[] ;
          response.data.data.list.forEach((item: any) => {
            let NewItem: BookList = {
              author: item.author,
              bookId: item.bookId,
              categoryName: item.categoryName,
              chapterStatus: item.chapterStatus,
              coverImg: item.coverImg,
              desc: item.desc,
              title: item.title,
              word: item.word
            };
            bookList.push(NewItem);
          });
        //   bookList = NewItems;
        });
    return bookList;
}